/**
*@Author      ：anlzou
*@Date        ：10:48 2021/4/23
*@Github      ：https://github.com/anlzou
*@Description ：
*/
package com.anlzou.cr_threads4method;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Cr_Executors {
    public void createThreadsPoo(){
        // 利用工具类Executors创建线程池
        ExecutorService threadPool = Executors.newFixedThreadPool(10);  //创建使用固定线程数的线程池
        threadPool.execute(new Cr_ExtendsThread());         // 适用于继承Thread类的线程
        threadPool.execute(new Cr_ImplementsRunnable());    // 适用于实现Runnable接口的线程
        threadPool.submit(new Cr_CallableAndFutureTask());  // 适用于实现Callable接口的线程
        threadPool.shutdown();
    }
}
